<template>
	<villageSort ref="villageSort" />
</template>

<script>	
import villageSort from '@/components/villageSort.vue';
import { listByVillage } from '@/api/home.js';

export default {
	name: 'Right2HomeVillage',
	components: {
		villageSort,		
	},
	data() {
		return {
			query: {
				year: parseInt(new Date().getFullYear()),
				categoryId: null, //1-香榧 2-笋竹 3-山黄精
			},			
		};
	},
	
	mounted() {
		this.loadData();
	},
	methods: {
		loadData() {
			listByVillage(this.query).then(result => {
				console.log('listByVillage Result = ', result);				
				let listPlant = result.listPlant;
				let listSale = result.listSale;
				this.$refs.villageSort.initListData(listPlant,listSale)
			});
		},
	}
};
</script>
<style lang="scss" scoped>
</style>
